<?php

namespace App\Models;

class TagMap extends Model
{
    protected $fillable = ['tid', 'aid'];

    public function tag()
    {
        $this->belongsTo(Tag::class);
    }

    public function articles()
    {
        $this->belongsTo(Article::class);
    }

    public function delArticleTag($aid)
    {
        $this->where('aid',$aid)->delete();
    }
}
